@*Hdip Project 2013-14, Student Name:- Chris Pembroke,  Student Number:- x00115839*@
@model IEnumerable<Exercise1Project.Models.BikeService>

@{
    ViewBag.Title = "ServiceList";
    string customerId = TempData["CustomerId"].ToString();
    TempData.Keep("CustomerId");
    ViewBag.bike_model = TempData["bike_model"].ToString();
    TempData.Keep("bike_model"); 
    ViewBag.bike_make = TempData["bike_make"].ToString(); 
    TempData.Keep("bike_make");
    ViewBag.bike_color =TempData["bike_color"].ToString();
    TempData.Keep("bike_color");
    ViewBag.bike_id = TempData["bike_id"].ToString();
    TempData.Keep("bike_id");
}

<div class="viewContainerDiv1">

    <h2>ServiceList</h2>

    <p>
        @Html.ActionLink("Create Quote", "Create", new { id = 0 }) &nbsp&nbsp&nbsp&nbsp&nbsp @Html.ActionLink("Create Service", "Create", new { id = 1 })
    </p>

    <table class="table">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.StatusBikeInShop)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.StatusService)
            </th>
            <th>

            </th>
            <th>

            </th>
            <th>@ViewBag.bike_model - @ViewBag.bike_make - @ViewBag.bike_color - ID @ViewBag.bike_id</th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.StatusBikeInShop)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.StatusService)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.QuotedPrice)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Date)
                </td>

                <td>
                    @if (item.StatusService == "Quote" || item.StatusService == "Booked")
                    {
                         @Html.ActionLink("Edit |", "Edit", new { id = item.ServiceID }) 
                    }
                    
                    @Html.ActionLink("Details", "Details", new { id = item.ServiceID }) 

                    @if (item.StatusService == "Quote" || item.StatusService == "Booked" || item.StatusService == "Cancelled")
                    { 
                         @Html.ActionLink("| Delete", "Delete", new { id = item.ServiceID }) 
                    }
                    @if(item.StatusService == "Done")
                    { 
                        @Html.ActionLink("| Paypal", "Paypal", new { id = item.ServiceID })
                    }
                </td>

            </tr>
        }
    </table>

    <p>
        @Html.ActionLink("Bikes", "BikeList", new { id = customerId })
    </p>

</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <link rel="stylesheet" href="@Url.Content("~/Content/customised.css")" />

}

